package com.itheima.controller;

import com.itheima.entity.JobOption;
import com.itheima.entity.Result;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/report")
@RestController
public class ReportController {

    @Autowired
    private ReportService reportService;
    /**
     * 统计各职位员工个数
     * @return
     */
    @GetMapping("/empJobData")
    public Result empJobData(){
        JobOption jobOption = reportService.empJobData();
        return Result.success(jobOption);
    }

    /**
     * 统计各性别员工个数
     * @return
     */
    @GetMapping("/empGenderData")
    public Result empGenderData(){
        List<Map> list = reportService.empGenderData();
        return Result.success(list);
    }
}
